cmake_minimum_required(VERSION 3.16)
project(web_server C CXX)
set(PROJECT_NAME web_server )

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20")

set(project_root $ENV{CODE_DIR}/web_server)

find_library(LIBRT rt)
find_package(OpenSSL REQUIRED)
find_package(workflow REQUIRED CONFIG HINTS $ENV{CODE_DIR}/workflow)

link_directories(${WORKFLOW_LIB_DIR})

include_directories(
${project_root}/src 
$ENV{CODE_DIR}/cppbase

${OPENSSL_INCLUDE_DIR} 
${WORKFLOW_INCLUDE_DIR}
)

set(CMAKE_BUILD_TYPE "Debug")

ADD_SUBDIRECTORY(src)
set(cppbase_lib $ENV{CODE_DIR}/cppbase/build/libcppbase.a)
aux_source_directory(. server_SRCS)

add_executable(${PROJECT_NAME} 
${server_SRCS}
)

set(WORKFLOW_LIB workflow ${LIBRT})





TARGET_LINK_LIBRARIES(${PROJECT_NAME}
${WORKFLOW_LIB}
http
${cppbase_lib}
protodef
#asy_task
 )




#target_sources(grpc_server PRIVATE ${gserver_SRCS})



